#include <iostream>
#include <unistd.h>
#include <string>
#include <signal.h>

void Usage()
{
    std::cout << "Usage:\n\t" << "./mykill signum pid\n" << std::endl;
}

// ./mykill signum pid
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage();
        exit(1);
    }
   
    int signum = std::stoi(argv[1]);
    pid_t pid = std::stoi(argv[2]);

    int n = kill(pid, signum);
    if (n == -1)
    {
        perror("kill");
        exit(2);
    }
    return 0;
}